#! /bin/bash

# If you want an SVN compiled version, download it now...
#svn checkout svn://svn.berlios.de/linux-uvc/linux-uvc/trunk

#if [ 1 == 0 ]; then 
if [ -e trunk ]; then 
	pushd .

	cd trunk/
	make clean
	make
	
	popd

	cp trunk/uvcvideo.ko uvcvideo.ko-svn
	cp uvcvideo.ko-svn uvcvideo.ko
fi

#if [ 1 == 0 ]; then 
if [ -e Uvcvideo_Source_071127.rar ]; then 
	# This stuff installs from the Asus source - may not cooperate with Fedora much though
	pushd .

	# this rar file was released by Asus 
	unrar x -y Uvcvideo_Source_071127.rar 
	tar -xzf uvcvideo_20070706-4.tar.gz 

	# This is the meat of it
	cd uvcvideo
	tar -xzf uvcvideo.tar.gz 
	# This patch file created by :
	# diff -c uvcvideo-asus uvcvideo > 2.6.24.eee.1.patch
	patch -p0 < ../asus_sources-2.6.24.eee.patch
	cd uvcvideo
	make clean
	make 
	cp *.ko ../../uvcvideo.ko-asus
	popd

	cp uvcvideo.ko-asus uvcvideo.ko

 # Clean up
#	rm -rf uvcvideo uvcvideo_20070706-4.*
fi


# Build lucview
if [ -e luvcview-20070512.tar.gz ]; then 
	# No need - if we've run the 'ahead.... .pl' in the main directory
	# yum install SDL SDL-devel
 
	pushd .
 tar -xzf luvcview-20070512.tar.gz
	cd luvcview-20070512
	make clean
	make
	cp luvcview ../
 popd
fi

if [ -e uvcvideo.ko-svn ]; then 
 echo "uvcvideo.ko-svn exists"
	# cp uvcvideo.ko-svn uvcvideo.ko
fi

# Interesting : http://forum.skype.com/index.php?showtopic=102838
